// 响应式设计样式

// 中等屏幕 (1200px 以下)
@media (max-width: 1200px) {
  .app-container {
    min-width: 720px;
  }

  .main-container {
    min-width: 380px;
  }

  .app-main {
    .main-content {
      padding: 20px;
      min-width: 300px;

      .page-content {
        min-width: 260px;
      }
    }
  }

  .dify-chat-container .chat-cards {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
  }
}

// 小屏幕 (992px 以下)
@media (max-width: 992px) {
  .app-container {
    min-width: 640px;
  }

  .main-container {
    min-width: 360px;
  }

  .app-aside {
    width: 220px !important;

    .logo-section {
      padding: 12px 16px;

      .header-title {
        font-size: 16px;
      }

      .header-logo {
        width: 28px;
        height: 28px;
      }
    }

    .sidebar-nav {
      .nav-menu {
        .el-menu-item {
          padding: 0 16px 0 32px;
          margin: 2px 8px;
          height: 40px;
          line-height: 40px;

          span {
            font-size: 13px;
          }

          i {
            font-size: 14px;
          }
        }

        .el-menu-item-group {
          .el-menu-item-group__title {
            padding: 10px 16px 6px 16px;
            font-size: 11px;
          }
        }
      }
    }
  }

  .app-main {
    .main-content {
      padding: 16px;
      min-width: 280px;

      .page-content {
        min-width: 240px;
      }
    }
  }

  .dify-chat-container .chat-cards {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
  }
}

// 平板设备 (768px 以下)
@media (max-width: 768px) {
  .app-container {
    min-width: 576px;
  }

  .main-container {
    min-width: 320px;
  }

  .app-aside {
    width: 200px !important;

    .logo-section {
      padding: 10px 12px;

      .header-title {
        font-size: 14px;
      }

      .header-logo {
        width: 24px;
        height: 24px;
        margin-right: 8px;
      }
    }

    .sidebar-nav {
      .nav-menu {
        .el-menu-item {
          padding: 0 12px 0 24px;
          margin: 1px 6px;
          height: 36px;
          line-height: 36px;

          span {
            font-size: 12px;
          }

          i {
            font-size: 13px;
            margin-right: 8px;
          }
        }

        .el-menu-item-group {
          .el-menu-item-group__title {
            padding: 8px 12px 4px 12px;
            font-size: 10px;
          }
        }
      }
    }
  }

  .app-header {
    padding: 0 12px;

    .page-title {
      font-size: 16px;
    }

    .header-links {
      gap: 8px;

      .header-link {
        width: 32px;
        height: 32px;
        font-size: 14px;

        i {
          font-size: 14px;
        }

        &.github-link {
          background-size: 16px 16px;
        }
      }
    }
  }

  .app-main {
    .main-content {
      padding: 12px;
      min-width: 260px;

      .page-content {
        padding: 16px;
        border-radius: 8px;
        min-width: 220px;
      }
    }
  }

  .dify-chat-container .chat-cards {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;

    .chat-card {
      .card-header {
        padding: 16px;

        .card-title {
          font-size: 16px;
        }
      }

      .card-content {
        padding: 16px;
      }
    }
  }
}

// 手机设备 (576px 以下)
@media (max-width: 576px) {
  .app-container {
    min-width: 375px;
    flex-direction: column;
  }

  .app-aside {
    width: 100% !important;
    height: auto;
    max-height: 200px;
    order: 2;

    .aside-content {
      flex-direction: row;
    }

    .logo-section {
      flex-shrink: 0;
      width: 200px;
    }

    .sidebar-nav {
      flex: 1;
      padding: 0;
      overflow-x: auto;

      .nav-menu {
        display: flex;
        flex-direction: row;
        height: 60px;

        .el-menu-item-group {
          display: none;
        }

        .el-menu-item {
          flex-shrink: 0;
          white-space: nowrap;
          margin: 10px 5px;
          padding: 0 12px;
          height: 40px;
          line-height: 40px;
          min-width: 120px;
        }
      }
    }
  }

  .main-container {
    order: 1;
    min-width: 100%;
  }

  .dify-chat-container .chat-cards {
    padding: 8px;

    .chat-card {
      .card-header {
        padding: 12px;
      }

      .card-content {
        padding: 12px;
      }

      .card-actions {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;

        .action-buttons {
          justify-content: center;
        }
      }
    }
  }
}
